/* testcv.c
 * test the syscall for the lock and condition
 */
#include "utility.h"
char alL1[5] = "lock";
char alCV[3] = "cv";

void T(){
    int result;
    createCV(alCV, 2);
    createLock(alL1, 4);
    Printf("testcv 2:AT1 try to acquire a lock that named by RTAT \n");
    acquireLock(alL1, 4);
    Printf("testcv 2:AT1 got the lock that named by RTAT \n");
    signalCV(alL1, 4, alCV, 2);
    Printf("testcv 2:signal and gonna wait\n");
    waitCV(alL1, 4, alCV, 2);
    Printf("testcv 2:wake up\n");
    releaseLock(alL1, 4);
    deleteLock(alL1, 4);
    deleteCV(alCV, 2);

}

int main()
{
    T();
    Exit(0);
}

